package dao;

import java.sql.Connection;
import java.sql.SQLException;
import java.sql.Statement;

import entities.Subnet;

public class SubnetDAO extends DAO<Subnet>{

	public SubnetDAO(Connection conn) {
		super(conn);
	}

	@Override
	public boolean create(Subnet obj) throws SQLException {
		Statement stmt = this.connection.createStatement();
		String sql = "INSERT INTO SUBNET (NumberOfVM,Name,Login) " +
				"VALUES ("+obj.getNumberOfVM()+", "+this.braquet(obj.getName())+" , "+this.braquet(obj.getLoginUser())+");" ;
		stmt.executeUpdate(sql);
		stmt.close();			
		return true;
	}

	@Override
	public boolean delete(Subnet obj) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public boolean update(int id,Subnet obj) {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Subnet find(int id) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Subnet find(String name) throws SQLException {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean delete(int id) throws SQLException {
		// TODO Auto-generated method stub
		return false;
	}

}
